#include "reader.h"

// Node 1 Rank 1 Spell 01 FireBall1,		Rank 2 Spell 02 FireBall2,		Rank 3 Spell 03 FireBall3 
// Node 2 Rank 1 Spell 40 Tremor,			Rank 2 Spell 42 Aftershock,		Rank 3 Spell 49 EarthQuake
// Node 3 Rank 1 Spell 16 Rising Tide,		Rank 2 Spell 17 Cure Water 2,	Rank 3 Spell 23 Tsunami
// Node 4 Rank 1 Spell 27 Healing Wind		Rank 2 Spell 30 Gust,			Rank 3 Spell 36 Tornado

//////////////////////////
#ifndef CSTRING_	//2/18/08
#define CSTRING_
#include<cstring>	// for string compare
#endif							
//////////////////////////

///////////////////////////////////////////////////////////
// Rotate Code // 2/18/08 Cai

// switcher
void switchxy(int &x, int &y)
{
	int temp;
	temp = x;
	x = y;
	y = temp;
	return;
}

// rotates in a clockwise manner, the wheel spins right
// technically the degrees are moving in the negative direction
void RotateXY(int degree, int &x, int &y)
{
	switch(degree)
	{
	case 90:
		y *= -1;
		switchxy(x, y);
	case 180:
		x *= -1;
		y *= -1;
		break;
	case 270:
		x *= -1;
		switchxy(x, y);
		break;
	default:
		break;
	}
	return;
}

//// rotates in a clockwise manner, the wheel spins right
//// technically the degrees are moving in the negative direction
//int RotateY(int degree, int x, int y)
//{
//	switch(degree)
//	{
//	case 90:
//		y *= -1;
//		switchxy(x, y);
//	case 180:
//		x *= -1;
//		y *= -1;
//		break;
//	case 270:
//		x *= -1;
//		switchxy(x, y);
//		break;
//	default:
//		break;
//	}
//	return y;
//}

///////////////////////////////////////////////////////////

File fileReader::readFile(char FileName[24])
{
	File file;
	char dumbie;
	
	ifstream dataFileOutput;

	dataFileOutput.open(FileName, ios::in);
	if(!dataFileOutput)
	{
		cout << "Danger wille robison, DANGER!!! snaps" << endl;
	}

	dataFileOutput >> trunk;
	file.trunk = trunk;
	dataFileOutput >> dumbie;
	dataFileOutput >> nNodes >> dumbie;
	file.nNodes = nNodes;

	for (int i = 0; i < file.nNodes; i++)
	{
		for(int m = 0; m < 24; m++)
		{
			dataFileOutput >> file.spell[i][m] >> dumbie;
			if ( file.spell[i][m] == 99)
			{	
				break;
			}
			else
			{
				file.spell[i][m];
			}
		}
	} 

	dataFileOutput.close();
	return file;
}

void fileReader::setSpell(File file, char filename[], int size)
{
	int s = 0;
	int num = 0;

	for ( int i = 0; i < 20; i++)
	{	
		TrunkP.mPointX[i] = num;
		TrunkP.mPointY[i] = 0;
		num += 64;
	}


	for (int i = 0; i < 4; i++)
	{
		for(int m = 0; m < 20; m++)
		{
			if (file.spell[i][m] == 99)
			{
				break;
			}

			if ( m == 2 || m == 5 || m == 8 || m == 11 || m == 14) 
			{
				SpellHolder[i][s].Number = file.spell[i][m];
				setSpell(SpellHolder[i][s], findSpell(file.spell[i][m], filename, size));
				s++;
			}
		}
		s = 0;
	}


}

void fileReader::setSpell(Spell & Main, Spell Other)
{
	Main.Damage = Other.Damage;
	for(int i = 0; i < 10; i++)
	{
		Main.mPointX[i]=Other.mPointX[i];
		Main.mPointY[i]=Other.mPointY[i];
		Main.Number = Other.Number;
	}
}


Spell fileReader::findSpell(int num, char filename[], int size)
{
Spell spell;
spell.Effect = 0;
spell.ElementNumber = Fire;
spell.Power = 10;
spell.Number = num;

	switch (num)
	{
	case 00:
			return spell;
			break;
	case 01:
			// FireBallRank1;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 0;
			spell.mPointX[3] = 64;
			spell.mPointX[4] = 64;
			spell.mPointX[5] = 128;
			spell.mPointX[6] = 192;
			spell.mPointX[7] = 192;
			spell.mPointX[8] = 192;
			spell.mPointX[9] = 192;
			spell.mPointY[0] = 64;
			spell.mPointY[1] = 128;
			spell.mPointY[2] = 192;
			spell.mPointY[3] = 256;
			spell.mPointY[4] = 320;
			spell.mPointY[5] = 384;
			spell.mPointY[6] = 384;
			spell.mPointY[7] = 320;
			spell.mPointY[8] = 256;
			spell.mPointY[9] = 192;
			if(strcmp(filename, "sm_3.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(180, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			spell.Damage = 3;
			spell.ElementNumber = Fire;
			return spell;
			break;
case 02:
			// FireBallRank2;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 256;
			spell.mPointX[7] = 320;
			spell.mPointX[8] = 384;
			spell.mPointX[9] = 384;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 64;
			spell.mPointY[3] = 128;
			spell.mPointY[4] = 192;
			spell.mPointY[5] = 256;
			spell.mPointY[6] = 320;
			spell.mPointY[7] = 384;
			spell.mPointY[8] = 384;
			spell.mPointY[9] = 320;
			if(strcmp(filename, "sm_3.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(180, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			spell.Damage = 6;
			spell.ElementNumber = Fire;
			return spell;
			break;

case 03:
			// FireBallRank3;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 320;
			spell.mPointX[7] = 386;
			spell.mPointX[8] = 448;
			spell.mPointX[9] = 448;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 64;
			spell.mPointY[2] = 128;
			spell.mPointY[3] = 192;
			spell.mPointY[4] = 256;
			spell.mPointY[5] = 320;
			spell.mPointY[6] = 320;
			spell.mPointY[7] = 256;
			spell.mPointY[8] = 192;
			spell.mPointY[9] = 128;
			spell.Damage = 10;
			spell.ElementNumber = Fire;
			spell.Power = 100;
			return spell;
			break;

case 04:
			// Resist Fire 04
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 64;
			spell.mPointX[2] = 128;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 320;
			spell.mPointX[7] = 384;
			spell.mPointX[8] = 448;
			spell.mPointX[9] = 512;
			spell.mPointY[0] = 64;
			spell.mPointY[1] = 128;
			spell.mPointY[2] = 128;
			spell.mPointY[3] = 192;
			spell.mPointY[4] = 256;
			spell.mPointY[5] = 320;
			spell.mPointY[6] = 320;
			spell.mPointY[7] = 256;
			spell.mPointY[8] = 256;
			spell.mPointY[9] = 256;
			spell.Damage = 12;
			return spell;
			break;
case 05:
			//Resist Fire Two 05;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 64;
			spell.mPointX[2] = 128;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 256;
			spell.mPointX[7] = 256;
			spell.mPointX[8] = 320;
			spell.mPointX[9] = 384;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 64;
			spell.mPointY[2] = 128;
			spell.mPointY[3] = 128;
			spell.mPointY[4] = 64;
			spell.mPointY[5] = 0;
			spell.mPointY[6] = -64;
			spell.mPointY[7] = -128;
			spell.mPointY[8] = -192;
			spell.mPointY[9] = -192;
			spell.Damage = 24;
			return spell;
			break;

case 06:
			// Fire Armor;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 320;
			spell.mPointX[7] = 320;
			spell.mPointX[8] = 384;
			spell.mPointX[9] = 448;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = -64;
			spell.mPointY[2] = -64;
			spell.mPointY[3] = 0;
			spell.mPointY[4] = 64;
			spell.mPointY[5] = 128;
			spell.mPointY[6] = 128;
			spell.mPointY[7] = 64;
			spell.mPointY[8] = 0;
			spell.mPointY[9] = 0;
			spell.Damage = 36;
			return spell;
			break;

case 07:
			// Fire Counter 2;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 320;
			spell.mPointX[6] = 384;
			spell.mPointX[7] = 384;
			spell.mPointX[8] = 384;
			spell.mPointX[9] = 384;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 64;
			spell.mPointY[2] = 128;
			spell.mPointY[3] = 192;
			spell.mPointY[4] = 256;
			spell.mPointY[5] = 256;
			spell.mPointY[6] = 192;
			spell.mPointY[7] = 128;
			spell.mPointY[8] = 64;
			spell.mPointY[9] = 0;
			spell.Damage = 12;
			return spell;
			break;
case 8:
			// Fire Counter 3;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 320;
			spell.mPointX[5] = 384;
			spell.mPointX[6] = 448;
			spell.mPointX[7] = 448;
			spell.mPointX[8] = 448;
			spell.mPointX[9] = 512;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 64;
			spell.mPointY[2] = 64;
			spell.mPointY[3] = 0;
			spell.mPointY[4] = 0;
			spell.mPointY[5] = -64;
			spell.mPointY[6] = -64;
			spell.mPointY[7] = 0;
			spell.mPointY[8] = 64;
			spell.mPointY[9] = 64;
			spell.Damage = 24;
			return spell;
			break;

case 9:
			// Burn out;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 64;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 192;
			spell.mPointX[6] = 192;
			spell.mPointX[7] = 256;
			spell.mPointX[8] = 320;
			spell.mPointX[9] = 384;
			spell.mPointY[0] = -64;
			spell.mPointY[1] = -128;
			spell.mPointY[2] = -128;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -64;
			spell.mPointY[5] = 0;
			spell.mPointY[6] = 64;
			spell.mPointY[7] = 128;
			spell.mPointY[8] = 128;
			spell.mPointY[9] = 128;
			spell.Damage = 36;
			return spell;
			break;

case 10:
			// Fire Sprites;	
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 128;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 320;
			spell.mPointX[6] = 384;
			spell.mPointX[7] = 384;
			spell.mPointX[8] = 384;
			spell.mPointX[9] = 384;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 64;
			spell.mPointY[2] = 128;
			spell.mPointY[3] = 192;
			spell.mPointY[4] = 192;
			spell.mPointY[5] = 256;
			spell.mPointY[6] = 256;
			spell.mPointY[7] = 192;
			spell.mPointY[8] = 128;
			spell.mPointY[9] = 64;
			spell.Damage = 12;
			return spell;
			break;
case 11:
			// Scramble;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 128;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 320;
			spell.mPointX[7] = 320;
			spell.mPointX[8] = 384;
			spell.mPointX[9] = 384;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = -64;
			spell.mPointY[2] = -128;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -128;
			spell.mPointY[5] = -64;
			spell.mPointY[6] = 0;
			spell.mPointY[7] = 64;
			spell.mPointY[8] = 64;
			spell.mPointY[9] = 128;
			spell.Damage = 24;
			return spell;
			break;

case 12:
			// Resist Fire Three;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 128;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 320;
			spell.mPointX[7] = 320;
			spell.mPointX[8] = 320;
			spell.mPointX[9] = 320;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = -64;
			spell.mPointY[2] = -128;
			spell.mPointY[3] = -192;
			spell.mPointY[4] = -256;
			spell.mPointY[5] = -256;
			spell.mPointY[6] = -192;
			spell.mPointY[7] = -128;
			spell.mPointY[8] = -64;
			spell.mPointY[9] = 0;
			spell.Damage = 36;
			return spell;
			break;

case 13:
			// Purification;	
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 320;
			spell.mPointX[5] = 384;
			spell.mPointX[6] = 384;
			spell.mPointX[7] = 384;
			spell.mPointX[8] = 384;
			spell.mPointX[9] = 448;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 64;
			spell.mPointY[2] = 128;
			spell.mPointY[3] = 128;
			spell.mPointY[4] = 128;
			spell.mPointY[5] = 64;
			spell.mPointY[6] = 0;
			spell.mPointY[7] = -64;
			spell.mPointY[8] = -128;
			spell.mPointY[9] = -128;
			if(strcmp(filename, "sm_3.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(180, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			spell.Damage = 12;
			return spell;
			break;
case 14:
			// Water Cure;
		
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 320;
			spell.mPointX[6] = 384;
			spell.mPointX[7] = 384;
			spell.mPointX[8] = 448;
			spell.mPointX[9] = 512;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = -64;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -192;
			spell.mPointY[5] = -192;
			spell.mPointY[6] = -128;
			spell.mPointY[7] = -64;
			spell.mPointY[8] = 0;
			spell.mPointY[9] = 0;

			if(strcmp(filename, "sm_2.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(90, spell.mPointX[i], spell.mPointY[i]);
				}
			} else if(strcmp(filename, "sm_1.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(90, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			spell.Damage = 24;
			return spell;
			break;

case 15:
			// Resist Water 1;

			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 64;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 320;
			spell.mPointX[7] = 386;
			spell.mPointX[8] = 448;
			spell.mPointX[9] = 448;
			spell.mPointY[0] = 64;
			spell.mPointY[1] = 128;
			spell.mPointY[2] = 192;
			spell.mPointY[3] = 192;
			spell.mPointY[4] = 256;
			spell.mPointY[5] = 256;
			spell.mPointY[6] = 192;
			spell.mPointY[7] = 192;
			spell.mPointY[8] = 128;
			spell.mPointY[9] = 64;
			spell.Damage = 36;
			return spell;
			break;

	case 16:
			// Rising Tide;	
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 64;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 320;
			spell.mPointX[7] = 384;
			spell.mPointX[8] = 448;
			spell.mPointX[9] = 448;
			spell.mPointY[0] = -64;
			spell.mPointY[1] = -128;
			spell.mPointY[2] = -192;
			spell.mPointY[3] = -192;
			spell.mPointY[4] = -128;
			spell.mPointY[5] = -128;
			spell.mPointY[6] = -192;
			spell.mPointY[7] = -192;
			spell.mPointY[8] = -128;
			spell.mPointY[9] = -64;
			spell.Damage = 3;
			spell.ElementNumber = Water;
			return spell;
			break;
case 17:
			// Cure Water 2;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 320;
			spell.mPointX[6] = 384;
			spell.mPointX[7] = 384;
			spell.mPointX[8] = 448;
			spell.mPointX[9] = 512;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 64;
			spell.mPointY[3] = 128;
			spell.mPointY[4] = 192;
			spell.mPointY[5] = 192;
			spell.mPointY[6] = 128;
			spell.mPointY[7] = 64;
			spell.mPointY[8] = 0;
			spell.mPointY[9] = 0;
			if(strcmp(filename, "sm_2.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(180, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			spell.Damage = 6;
			spell.Effect = 6;
			spell.ElementNumber = Water;
			return spell;
			break;

case 18:


			// Resist Water 2;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 320;
			spell.mPointX[5] = 384;
			spell.mPointX[6] = 448;
			spell.mPointX[7] = 512;
			spell.mPointX[8] = 576;
			spell.mPointX[9] = 640;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = -64;
			spell.mPointY[2] = -128;
			spell.mPointY[3] = -192;
			spell.mPointY[4] = -192;
			spell.mPointY[5] = -192;
			spell.mPointY[6] = -128;
			spell.mPointY[7] = -64;
			spell.mPointY[8] = 0;
			spell.mPointY[9] = 0;
			spell.Damage = 36;
			return spell;
			break;

	case 19:
			// Water Armor;	
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 320;
			spell.mPointX[5] = 384;
			spell.mPointX[6] = 448;
			spell.mPointX[7] = 512;
			spell.mPointX[8] = 576;
			spell.mPointX[9] = 640;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 64;
			spell.mPointY[3] = 64;
			spell.mPointY[4] = 0;
			spell.mPointY[5] = 0;
			spell.mPointY[6] = -64;
			spell.mPointY[7] = -64;
			spell.mPointY[8] = 0;
			spell.mPointY[9] = 0;
			spell.Damage = 12;
			return spell;
			break;
case 20:
			// Water Counter 2;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 64;
			spell.mPointX[2] = 64;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 192;
			spell.mPointX[6] = 192;
			spell.mPointX[7] = 256;
			spell.mPointX[8] = 320;
			spell.mPointX[9] = 320;
			spell.mPointY[0] = -64;
			spell.mPointY[1] = -64;
			spell.mPointY[2] = -128;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -128;
			spell.mPointY[5] = -64;
			spell.mPointY[6] = 0;
			spell.mPointY[7] = 0;
			spell.mPointY[8] = 0;
			spell.mPointY[9] = -64;
			spell.Damage = 24;
			return spell;
			break;

case 21:


			// Freeze;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 128;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 256;
			spell.mPointX[7] = 256;
			spell.mPointX[8] = 320;
			spell.mPointX[9] = 384;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = -64;
			spell.mPointY[2] = -128;
			spell.mPointY[3] = -192;
			spell.mPointY[4] = -192;
			spell.mPointY[5] = -192;
			spell.mPointY[6] = -128;
			spell.mPointY[7] = -64;
			spell.mPointY[8] = 0;
			spell.mPointY[9] = 0;
			spell.Damage = 36;
			return spell;
			break;

	case 22:
			// Undertow;	
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 320;
			spell.mPointX[7] = 384;
			spell.mPointX[8] = 448;
			spell.mPointX[9] = 448;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = -64;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -192;
			spell.mPointY[5] = -256;
			spell.mPointY[6] = -320;
			spell.mPointY[7] = -320;
			spell.mPointY[8] = -256;
			spell.mPointY[9] = -192;
			spell.Damage = 12;
			return spell;
			break;
case 23:
			// Tsunami;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 320;
			spell.mPointX[6] = 384;
			spell.mPointX[7] = 448;
			spell.mPointX[8] = 512;
			spell.mPointX[9] = 512;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 64;
			spell.mPointY[3] = 128;
			spell.mPointY[4] = 192;
			spell.mPointY[5] = 192;
			spell.mPointY[6] = 192;
			spell.mPointY[7] = 128;
			spell.mPointY[8] = 128;
			spell.mPointY[9] = 64;
			spell.Damage = 7;
			spell.ElementNumber = Water;
			return spell;
			break;

case 24:


			// Cure Water 3;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 64;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 128;
			spell.mPointX[5] = 64;
			spell.mPointX[6] = 64;
			spell.mPointX[7] = 128;
			spell.mPointX[8] = 192;
			spell.mPointX[9] = 256;
			spell.mPointY[0] = 64;
			spell.mPointY[1] = 128;
			spell.mPointY[2] = 192;
			spell.mPointY[3] = 192;
			spell.mPointY[4] = 256;
			spell.mPointY[5] = 320;
			spell.mPointY[6] = 384;
			spell.mPointY[7] = 384;
			spell.mPointY[8] = 384;
			spell.mPointY[9] = 384;
			spell.Damage = 36;
			if(strcmp(filename, "sm_2.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(90, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			return spell;
			break;

case 25:
			// Water Counter 3;	
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 64;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 128;
			spell.mPointX[5] = 192;
			spell.mPointX[6] = 256;
			spell.mPointX[7] = 320;
			spell.mPointX[8] = 320;
			spell.mPointX[9] = 320;
			spell.mPointY[0] = -64;
			spell.mPointY[1] = -128;
			spell.mPointY[2] = -128;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -64;
			spell.mPointY[5] = 0;
			spell.mPointY[6] = 0;
			spell.mPointY[7] = 0;
			spell.mPointY[8] = -64;
			spell.mPointY[9] = -128;
			spell.Damage = 12;
			return spell;
			break;
case 26:
			// Resist Water 3;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 64;
			spell.mPointX[2] = 128;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 320;
			spell.mPointX[7] = 320;
			spell.mPointX[8] = 384;
			spell.mPointX[9] = 448;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = -64;
			spell.mPointY[2] = -64;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -192;
			spell.mPointY[5] = -192;
			spell.mPointY[6] = -192;
			spell.mPointY[7] = -128;
			spell.mPointY[8] = -64;
			spell.mPointY[9] = -64;
			spell.Damage = 24;
			return spell;
			break;

case 27:


			// Healing Wind;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 0;
			spell.mPointX[3] = 0;
			spell.mPointX[4] = 64;
			spell.mPointX[5] = 64;
			spell.mPointX[6] = 128;
			spell.mPointX[7] = 128;
			spell.mPointX[8] = 192;
			spell.mPointX[9] = 256;
			spell.mPointY[0] = 64;
			spell.mPointY[1] = 128;
			spell.mPointY[2] = 192;
			spell.mPointY[3] = 256;
			spell.mPointY[4] = 320;
			spell.mPointY[5] = 384;
			spell.mPointY[6] = 448;
			spell.mPointY[7] = 512;
			spell.mPointY[8] = 512;
			spell.mPointY[9] = 512;
			if(strcmp(filename, "sm_2.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(180, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			spell.Damage = 3;
			spell.Effect = 3;
			spell.ElementNumber = Wind;
			return spell;
			break;

case 28:
			// Resist Wind 1
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 128;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 192;
			spell.mPointX[6] = 128;
			spell.mPointX[7] = 128;
			spell.mPointX[8] = 192;
			spell.mPointX[9] = 192;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = -64;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -192;
			spell.mPointY[5] = -256;
			spell.mPointY[6] = -320;
			spell.mPointY[7] = -384;
			spell.mPointY[8] = -384;
			spell.mPointY[9] = -448;
			spell.Damage = 12;
			return spell;
			break;
case 29:
			// wind sprites;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 128;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 64;
			spell.mPointX[5] = 0;
			spell.mPointX[6] = 0;
			spell.mPointX[7] = 64;
			spell.mPointX[8] = 64;
			spell.mPointX[9] = 128;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = -64;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -192;
			spell.mPointY[5] = -192;
			spell.mPointY[6] = -256;
			spell.mPointY[7] = -320;
			spell.mPointY[8] = -384;
			spell.mPointY[9] = -384;
			spell.Damage = 24;
			return spell;
			break;

case 30:


			// Gust;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 320;
			spell.mPointX[5] = 384;
			spell.mPointX[6] = 448;
			spell.mPointX[7] = 512;
			spell.mPointX[8] = 512;
			spell.mPointX[9] = 448;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = -64;
			spell.mPointY[3] = -64;
			spell.mPointY[4] = -64;
			spell.mPointY[5] = 0;
			spell.mPointY[6] = 0;
			spell.mPointY[7] = 64;
			spell.mPointY[8] = 128;
			spell.mPointY[9] = 192;
			if(strcmp(filename, "sm_2.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(90, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			spell.Damage = 5;
			spell.ElementNumber = Wind;
			return spell;
			break;

	case 31:
			// Resist Wind 2;	
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 320;
			spell.mPointX[5] = 384;
			spell.mPointX[6] = 384;
			spell.mPointX[7] = 448;
			spell.mPointX[8] = 512;
			spell.mPointX[9] = 512;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 64;
			spell.mPointY[3] = 128;
			spell.mPointY[4] = 128;
			spell.mPointY[5] = 64;
			spell.mPointY[6] = 0;
			spell.mPointY[7] = 0;
			spell.mPointY[8] = 64;
			spell.mPointY[9] = 128;
			spell.Damage = 12;
			return spell;
			break;
case 32:
			// Wind Armor;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 320;
			spell.mPointX[6] = 384;
			spell.mPointX[7] = 448;
			spell.mPointX[8] = 512;
			spell.mPointX[9] = 512;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 64;
			spell.mPointY[3] = 64;
			spell.mPointY[4] = 128;
			spell.mPointY[5] = 128;
			spell.mPointY[6] = 128;
			spell.mPointY[7] = 128;
			spell.mPointY[8] = 192;
			spell.mPointY[9] = 256;
			spell.Damage = 24;
			return spell;
			break;

case 33:


			// Wind Counter 2;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 320;
			spell.mPointX[5] = 384;
			spell.mPointX[6] = 448;
			spell.mPointX[7] = 448;
			spell.mPointX[8] = 448;
			spell.mPointX[9] = 384;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = -64;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -128;
			spell.mPointY[5] = -128;
			spell.mPointY[6] = -64;
			spell.mPointY[7] = 0;
			spell.mPointY[8] = 64;
			spell.mPointY[9] = 128;
			spell.Damage = 36;
			return spell;
			break;

case 34:
			// Headwind;	
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 320;
			spell.mPointX[7] = 384;
			spell.mPointX[8] = 384;
			spell.mPointX[9] = 320;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = -64;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -192;
			spell.mPointY[5] = -192;
			spell.mPointY[6] = -192;
			spell.mPointY[7] = -128;
			spell.mPointY[8] = -64;
			spell.mPointY[9] = 0;
			spell.Damage = 12;
			return spell;
			break;
case 35:
			// confusion;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 0;
			spell.mPointX[3] = 64;
			spell.mPointX[4] = 128;
			spell.mPointX[5] = 192;
			spell.mPointX[6] = 256;
			spell.mPointX[7] = 256;
			spell.mPointX[8] = 192;
			spell.mPointX[9] = 192;
			spell.mPointY[0] = -64;
			spell.mPointY[1] = -128;
			spell.mPointY[2] = -192;
			spell.mPointY[3] = -192;
			spell.mPointY[4] = -128;
			spell.mPointY[5] = -128;
			spell.mPointY[6] = -64;
			spell.mPointY[7] = 0;
			spell.mPointY[8] = 0;
			spell.mPointY[9] = 64;
			spell.Damage = 24;
			return spell;
			break;

case 36:
			// Tornado;				// adjusted coordinates 2/18/08 cai
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = -64;
			spell.mPointX[3] = -64;
			spell.mPointX[4] = -64;
			spell.mPointX[5] = 0;
			spell.mPointX[6] = 64;
			spell.mPointX[7] = 128;
			spell.mPointX[8] = 128;
			spell.mPointX[9] = 128;
			spell.mPointY[0] = 64;
			spell.mPointY[1] = 128;
			spell.mPointY[2] = 192;
			spell.mPointY[3] = 256;
			spell.mPointY[4] = 320;
			spell.mPointY[5] = 320;
			spell.mPointY[6] = 320;
			spell.mPointY[7] = 256;
			spell.mPointY[8] = 192;
			spell.mPointY[9] = 128;
			spell.Damage = 8;
			spell.ElementNumber = Wind;
			return spell;
			break;

case 37:
			// Second Wind;	
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 64;
			spell.mPointX[5] = 0;
			spell.mPointX[6] = -64;
			spell.mPointX[7] = -128;
			spell.mPointX[8] = -192;
			spell.mPointX[9] = -192;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 64;
			spell.mPointY[3] = 128;
			spell.mPointY[4] = 192;
			spell.mPointY[5] = 192;
			spell.mPointY[6] = 192;
			spell.mPointY[7] = 128;
			spell.mPointY[8] = 128;
			spell.mPointY[9] = 64;
			spell.Damage = 12;
			if(strcmp(filename, "sm_4.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(180, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			return spell;
			break;
case 38:
			// Resist Wind 3;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = -64;
			spell.mPointX[3] = -128;
			spell.mPointX[4] = -192;
			spell.mPointX[5] = -192;
			spell.mPointX[6] = -192;
			spell.mPointX[7] = -128;
			spell.mPointX[8] = -182;
			spell.mPointX[9] = -192;
			spell.mPointY[0] = 64;
			spell.mPointY[1] = 128;
			spell.mPointY[2] = 192;
			spell.mPointY[3] = 192;
			spell.mPointY[4] = 128;
			spell.mPointY[5] = 64;
			spell.mPointY[6] = 0;
			spell.mPointY[7] = -64;
			spell.mPointY[8] = -128;
			spell.mPointY[9] = -128;
			spell.Damage = 24;
			return spell;
			break;

case 39:


			// Wind Counter 3;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 0;
			spell.mPointX[3] = -64;
			spell.mPointX[4] = -64;
			spell.mPointX[5] = -128;
			spell.mPointX[6] = -192;
			spell.mPointX[7] = -256;
			spell.mPointX[8] = -256;
			spell.mPointX[9] = -320;
			spell.mPointY[0] = 64;
			spell.mPointY[1] = 128;
			spell.mPointY[2] = 192;
			spell.mPointY[3] = 256;
			spell.mPointY[4] = 320;
			spell.mPointY[5] = 320;
			spell.mPointY[6] = 192;
			spell.mPointY[7] = 192;
			spell.mPointY[8] = 128;
			spell.mPointY[9] = 128;
			spell.Damage = 36;
			return spell;
			break;

case 40:
			// Tremor;	// 
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 0;
			spell.mPointX[3] = 64;
			spell.mPointX[4] = 128;
			spell.mPointX[5] = 192;
			spell.mPointX[6] = 192;
			spell.mPointX[7] = 192;
			spell.mPointX[8] = 192;
			spell.mPointX[9] = 192;
			spell.mPointY[0] = -64;
			spell.mPointY[1] = -128;
			spell.mPointY[2] = -192;
			spell.mPointY[3] = -192;
			spell.mPointY[4] = -192;
			spell.mPointY[5] = -192;
			spell.mPointY[6] = -256;
			spell.mPointY[7] = -320;
			spell.mPointY[8] = -384;
			spell.mPointY[9] = -448;
			if(strcmp(filename, "sm_3.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(180, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			if(strcmp(filename, "sm_4.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(180, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			spell.Damage = 3;
			spell.ElementNumber = Earth;
			return spell;
			break;
case 41:
			// Earth Resist 1;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 320;
			spell.mPointX[7] = 384;
			spell.mPointX[8] = 448;
			spell.mPointX[9] = 512;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 0;
			spell.mPointY[3] = 64;
			spell.mPointY[4] = 64;
			spell.mPointY[5] = 128;
			spell.mPointY[6] = 128;
			spell.mPointY[7] = 128;
			spell.mPointY[8] = 128;
			spell.mPointY[9] = 128;
			spell.Damage = 24;
			return spell;
			break;

case 42:


			// Aftershock;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 128;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 192;
			spell.mPointX[6] = 128;
			spell.mPointX[7] = 128;
			spell.mPointX[8] = 64;
			spell.mPointX[9] = 64;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = -64;
			spell.mPointY[3] = -64;
			spell.mPointY[4] = -128;
			spell.mPointY[5] = -192;
			spell.mPointY[6] = -192;
			spell.mPointY[7] = -256;
			spell.mPointY[8] = -256;
			spell.mPointY[9] = -320;
			if(strcmp(filename, "sm_3.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(180, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			spell.Damage = 6;
			spell.ElementNumber = Earth;
			return spell;
			break;

case 43:
			// Rejuvenate;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 0;
			spell.mPointX[3] = 0;
			spell.mPointX[4] = 64;
			spell.mPointX[5] = 128;
			spell.mPointX[6] = 192;
			spell.mPointX[7] = 192;
			spell.mPointX[8] = 192;
			spell.mPointX[9] = 192;
			spell.mPointY[0] = -64;
			spell.mPointY[1] = -128;
			spell.mPointY[2] = -192;
			spell.mPointY[3] = -256;
			spell.mPointY[4] = -256;
			spell.mPointY[5] = -256;
			spell.mPointY[6] = -256;
			spell.mPointY[7] = -192;
			spell.mPointY[8] = -128;
			spell.mPointY[9] = -64;
			if(strcmp(filename, "sm_4.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(180, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			spell.Damage = 12;
			return spell;
			break;
case 44:
			// Earth Resist 2;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 256;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 192;
			spell.mPointX[7] = 192;
			spell.mPointX[8] = 128;
			spell.mPointX[9] = 128;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 0;
			spell.mPointY[3] = 0;
			spell.mPointY[4] = -64;
			spell.mPointY[5] = -128;
			spell.mPointY[6] = -128;
			spell.mPointY[7] = -256;
			spell.mPointY[8] = -256;
			spell.mPointY[9] = -320;
			spell.Damage = 24;
			return spell;
			break;

case 45:


			// Earth Armor;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 0;
			spell.mPointX[3] = 0;
			spell.mPointX[4] = 64;
			spell.mPointX[5] = 128;
			spell.mPointX[6] = 192;
			spell.mPointX[7] = 192;
			spell.mPointX[8] = 192;
			spell.mPointX[9] = 128;
			spell.mPointY[0] = 64;
			spell.mPointY[1] = 128;
			spell.mPointY[2] = 192;
			spell.mPointY[3] = 256;
			spell.mPointY[4] = 256;
			spell.mPointY[5] = 256;
			spell.mPointY[6] = 256;
			spell.mPointY[7] = 192;
			spell.mPointY[8] = 128;
			spell.mPointY[9] = 128;
			spell.Damage = 36;
			return spell;
			break;

case 46:
			// Earth Counter 2;	
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 128;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 256;
			spell.mPointX[6] = 256;
			spell.mPointX[7] = 320;
			spell.mPointX[8] = 384;
			spell.mPointX[9] = 384;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = -64;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -128;
			spell.mPointY[5] = -128;
			spell.mPointY[6] = -64;
			spell.mPointY[7] = -64;
			spell.mPointY[8] = -64;
			spell.mPointY[9] = -128;
			spell.Damage = 12;
			return spell;
			break;
case 47:
			// Grounding;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 64;
			spell.mPointX[3] = 64;
			spell.mPointX[4] = 128;
			spell.mPointX[5] = 128;
			spell.mPointX[6] = 192;
			spell.mPointX[7] = 192;
			spell.mPointX[8] = 256;
			spell.mPointX[9] = 256;
			spell.mPointY[0] = -64;
			spell.mPointY[1] = -128;
			spell.mPointY[2] = -128;
			spell.mPointY[3] = -192;
			spell.mPointY[4] = -192;
			spell.mPointY[5] = -256;
			spell.mPointY[6] = -256;
			spell.mPointY[7] = -320;
			spell.mPointY[8] = -320;
			spell.mPointY[9] = -384;
			spell.Damage = 24;
			return spell;
			break;

case 48:


			// Sling Mud;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 192;
			spell.mPointX[4] = 192;
			spell.mPointX[5] = 128;
			spell.mPointX[6] = 128;
			spell.mPointX[7] = 64;
			spell.mPointX[8] = 64;
			spell.mPointX[9] = 0;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 0;
			spell.mPointY[3] = -64;
			spell.mPointY[4] = -128;
			spell.mPointY[5] = -128;
			spell.mPointY[6] = -192;
			spell.mPointY[7] = -192;
			spell.mPointY[8] = -256;
			spell.mPointY[9] = -256;
			spell.Damage = 36;
			return spell;
			break;


case 49:
			// Earthquake;	
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 0;
			spell.mPointX[3] = 0;
			spell.mPointX[4] = 0;
			spell.mPointX[5] = 0;
			spell.mPointX[6] = 0;
			spell.mPointX[7] = 0;
			spell.mPointX[8] = 0;
			spell.mPointX[9] = 0;
			spell.mPointY[0] = -64;
			spell.mPointY[1] = -128;
			spell.mPointY[2] = -192;
			spell.mPointY[3] = -256;
			spell.mPointY[4] = -320;
			spell.mPointY[5] = -384;
			spell.mPointY[6] = -448;
			spell.mPointY[7] = -512;
			spell.mPointY[8] = -576;
			spell.mPointY[9] = -640;
			if(strcmp(filename, "sm_2.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(180, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			else if(strcmp(filename, "sm_3.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(270, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			else if(strcmp(filename, "sm_4.txt") == 0)
			{
				for(int i = 0; i < 10; i++)
				{
					RotateXY(270, spell.mPointX[i], spell.mPointY[i]);
				}
			}
			spell.Damage = 9;
			spell.ElementNumber = Earth;
			return spell;
			break;
case 50:
			// Earth Resist 3;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 320;
			spell.mPointX[5] = 384;
			spell.mPointX[6] = 448;
			spell.mPointX[7] = 512;
			spell.mPointX[8] = 576;
			spell.mPointX[9] = 640;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 0;
			spell.mPointY[3] = 0;
			spell.mPointY[4] = 0;
			spell.mPointY[5] = 0;
			spell.mPointY[6] = 0;
			spell.mPointY[7] = 0;
			spell.mPointY[8] = 0;
			spell.mPointY[9] = 0;
			spell.Damage = 24;
			return spell;
			break;

case 51:


			// Earth Counter 3;
			spell.mPointX[0] = 64;
			spell.mPointX[1] = 128;
			spell.mPointX[2] = 192;
			spell.mPointX[3] = 256;
			spell.mPointX[4] = 320;
			spell.mPointX[5] = 384;
			spell.mPointX[6] = 448;
			spell.mPointX[7] = 512;
			spell.mPointX[8] = 576;
			spell.mPointX[9] = 640;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 0;
			spell.mPointY[3] = 0;
			spell.mPointY[4] = 0;
			spell.mPointY[5] = 0;
			spell.mPointY[6] = 0;
			spell.mPointY[7] = 0;
			spell.mPointY[8] = 0;
			spell.mPointY[9] = 0;
			spell.Damage = 36;
			return spell;
			break;


case 52:
			// Burial;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 64;
			spell.mPointX[3] = 128;
			spell.mPointX[4] = 128;
			spell.mPointX[5] = 128;
			spell.mPointX[6] = 64;
			spell.mPointX[7] = 64;
			spell.mPointX[8] = 64;
			spell.mPointX[9] = 0;
			spell.mPointY[0] = -64;
			spell.mPointY[1] = -128;
			spell.mPointY[2] = -128;
			spell.mPointY[3] = -128;
			spell.mPointY[4] = -192;
			spell.mPointY[5] = -256;
			spell.mPointY[6] = -256;
			spell.mPointY[7] = -320;
			spell.mPointY[8] = -384;
			spell.mPointY[9] = -384;
			spell.Damage = 12;
			return spell;
			break;

default:
			// FireBallRank3;
			spell.mPointX[0] = 0;
			spell.mPointX[1] = 0;
			spell.mPointX[2] = 0;
			spell.mPointX[3] = 0;
			spell.mPointX[4] = 0;
			spell.mPointX[5] = 0;
			spell.mPointX[6] = 0;
			spell.mPointX[7] = 0;
			spell.mPointX[8] = 0;
			spell.mPointX[9] = 0;
			spell.mPointY[0] = 0;
			spell.mPointY[1] = 0;
			spell.mPointY[2] = 0;
			spell.mPointY[3] = 0;
			spell.mPointY[4] = 0;
			spell.mPointY[5] = 0;
			spell.mPointY[6] = 0;
			spell.mPointY[7] = 0;
			spell.mPointY[8] = 0;
			spell.mPointY[9] = 0;
			spell.Damage = 0;
			return spell;
}
}